<!DOCTYPE html>
<html>
<head lang="en">
    <include file="Public/head" />
    <link rel="stylesheet" href="__PUBLIC__/Home/static/css/index.css"/>
    <link rel="stylesheet" href="__PUBLIC__/Home/static/css/fans.css"/>
    <script>
        var user = {$user|json_encode};
        if (user.avatar == '') {
            user.avatar = default_avatar;
        }
        {:C('GLOBAL_BDHM')}
    </script>
</head>
<body>
    <include file="Public/header" />
    <div class="main">
        <div class="main-content">
            <div class="sidebar">
                {$selfHtml}
            </div>
            <div class="content-right">
                <div class="fans-title">
                    <span>粉丝</span>
                    <span>{$user.statis.fans}</span>
                </div>
                <div class="fans-search">
                    <div class="search-box">
                        <input type="text" placeholder="输入昵称搜索" class="search-content" value="{$nickname}"/>
                        <input type="button" value="搜索" class="search-btn js-search-fans"/>
                    </div>
                </div>
                <div class="fans-list">
                    <volist name="fansList" id="fans">
                        <div class="fans-item" data-id="{$fans.id}">
                            <div class="fans-avatar">
                                <a href="{:U('Others/index', array('uid' => $fans['id']))}">
                                    <img src="{$fans.avatar|default="__PUBLIC__/Home/static/images/avatar-mr.png"}" alt="{$fans.nickname}"/>
                                </a>
                            </div>
                            <div class="fans-info">
                                <div class="fans-infos">
                                    <div class="fans fans-nickname">
                                        <a href="{:U('Others/index', array('uid' => $fans['id']))}">{$fans.nickname}</a>
                                    </div>
                                    <switch name="fans.gender">
                                        <case value="男">
                                            <div class="fans fans-sex1">
                                                <i></i>
                                            </div>
                                        </case>
                                        <case value="女">
                                            <div class="fans fans-sex">
                                                <i></i>
                                            </div>
                                        </case>
                                    </switch>
                                    <div class="fans fans-level">LV.{$fans.level}</div>
                                </div>
                                <div class="fans-num">
                                    <div class="fans fans-fans">
                                        <span>粉丝</span>
                                        <span class="blue">{$fans.statis.fans|default=0}</span>
                                    </div>
                                    <div class="fans fans-follow">
                                        <span>关注</span>
                                        <span class="blue">{$fans.statis.follows|default=0}</span>
                                    </div>
                                    <div class="fans fans-dt">
                                        <span>动态</span>
                                        <span class="blue">{$fans.activityCount|default=0}</span>
                                    </div>
                                </div>
                            </div>
                            <div class="fans-btn">
                                <i></i>
                                <input type="button" value="更多" class="more"/>
                                <notempty name="fans.action.is_follow">
                                    <input type="button" class="js-follow" data-uid="{$fans.id}" data-status="1" value="已关注"/>
                                <else />
                                    <input type="button" class="js-follow" data-uid="{$fans.id}" data-status="0" value="加关注"/>
                                </notempty>
                            </div>
                            <div class="btn-hide">
                                <ul>
                                    <li><a href="javascript:;" onclick="warning()">发私信</a></li>
                                    <li><a href="javascript:;" class="js-remove-fans">移除粉丝</a></li>
                                </ul>
                            </div>
                        </div>
                    </volist>
                </div>
                <div class="page">
                    {$paging}
                </div>
            </div>
        </div>
    </div>
<include file="common/footer" />
</body>
<script src="__PUBLIC__/Home/static/js/fans.js"></script>
<script type="text/javascript">
    $(document).ready(function(e) {
        $(".search-box input").keydown(search);
        $(".js-search-fans").click(search);
    });
    var search = function() {
        var nickname = $(".search-box input").val();
        if (nickname.length > 0) {
            location.href = "{:U('Ucenter/fans')}?nickname="+nickname;
        } else {
            location.href = "{:U('Ucenter/fans')}";
        }
    }
    var followCallBack = function(followUid, status) {
        var cnt = parseInt($('.mine').find('#followCount').attr('data-count'));
        if (status) {
            //取消关注，关注人数减一
            $('.mine').find('#followCount').attr('data-count', (cnt-1));
            $('.mine').find('#followCount').text("关注：" + (cnt-1));
        } else {
            $('.mine').find('#followCount').attr('data-count', (cnt+1));
            $('.mine').find('#followCount').text("关注：" + (cnt+1));
        }
    }
    var warning = function() {
        alert('功能正在开发中...');
    }
</script>
</html>